# Maintainer: Daniel Isenmann <daniel@archlinux.org>

pkgname=gegl
_tag='e10b8c9114614dc724390a7e737eafd97f47430f'
pkgver=0.4.44
pkgrel=1
pkgdesc='Graph based image processing framework'
arch=('x86_64')
url='https://www.gegl.org/'
license=('GPL3' 'LGPL3')
depends=('babl' 'jasper' 'json-glib' 'lensfun' 'libgexiv2' 'libraw' 'librsvg' 'libspiro'
         'libtiff' 'luajit' 'openexr' 'poppler-glib' 'suitesparse')
makedepends=('exiv2' 'ffmpeg' 'git' 'glu' 'gobject-introspection' 'intltool' 'mesa'
             'meson' 'python-gobject' 'ruby' 'vala')
optdepends=('ffmpeg: ffmpeg plugin'
            'graphviz: for gegl-introspect')
source=("git+https://gitlab.gnome.org/GNOME/gegl.git#tag=$_tag")
sha256sums=('SKIP')

pkgver() {
  cd "${pkgname}"
  git describe --tags | sed 's/^GEGL_//;s/_$//;s/_/./g;s/-/+/g'
}

build() {
  mkdir -p build
  cd build
  arch-meson ../"${pkgname}" \
    -Dworkshop=true \
    -Dmrg=disabled \
    -Dmaxflow=disabled
  ninja
}

check() {
  cd build
  ninja test || :
}

package() {
  cd build
  DESTDIR="${pkgdir}" ninja install
}
